* incorrect udp checkums ? (seen with tcpdump) with software from within virtualbox
  \ fix: ethtool --offload eth0 rx off tx off ; ethtool -K eth0 gso off
  \ ^ apparently this works even when you get networking freezes right after you get 'Detected Tx Unit Hang' within virtualbox. - either that, or it just got better by itself. (but for example you couldn't even navigate in make nconfig due to the network delay/lags)
  \ within the virtualbox guest OS
  \ src: http://ubuntuforums.org/showthread.php?t=1940190
  \ see also: https://bugzilla.kernel.org/show_bug.cgi?id=47331#c30
  \ which suggests this(didn't try yet): ethtool -s eno1 speed 100 duplex full
* how to echo(or use) escape chars without using echo -e
  \ echo -e '\n'
  \ echo $'\n'

* don't update samsung ssd 840 evo 's firmware to EXT0DB6Q  (currently still EXT0BB6Q) even though the intermediary EXT0CB6Q apparently is working as reported here: http://www.overclock.net/t/1507897/samsung-840-evo-read-speed-drops-on-old-written-data-in-the-drive/2660
  \ motherlode src: https://bugs.launchpad.net/ubuntu/+source/fstrim/+bug/1449005

* the 3 sec delay when login password is wrong is in /etc/login.defs as FAIL_DELAY 3
  \ this doesn't affect wrong password for sudo (delay 3 sec also)

- kernel 4.2.0 rc2 (tag) crashes system when startx inside a virtualbox (4.3.26) so you should update to the immediate commits after it (specifically this: 4.2.0-rc2-g97d6e2b) - tested to not crash anymore.
  \ NOPE: it still OOPSes after a few minutes... so maybe that didn't get fixed at all!


* to force kernel to reread partition (sfdisk -R  doesn't work anymore)
  \ sudo blockdev --rereadpt /dev/sde

* when dd-ing manjaro iso to the usb stick card reader(on the 4g sd ms pro duo):
  \ $ time sudo dd if=./manjaro-xfce-15.12-x86_64.iso of=/dev/sdc bs=6M
  \ Password: 
  \ 244+1 records in
  \ 244+1 records out
  \ 1537474560 bytes (1.5 GB) copied, 289.137 s, 5.3 MB/s
  \
  \ real  5m18.005s
  \ user  0m0.030s
  \ sys 0m23.307s

* when dd-ing the gentoo admincd iso to the usb stick or card reader:
  * $ sudo dd if=admincd-amd64-20150910.iso of=/dev/sde bs=6M
    \ 404750336 bytes (405 MB) copied, 75.8235 s, 5.3 MB/s
  * $ sudo blockdev --rereadpt /dev/sde
    \ needed so that lsblk sees the right partitions after the dd-ing above.
    \ that is the equivalent of: sfdisk -R (which nolonger works; its man does say about blockdev)


* telinit q (or Q) will tell init to re-read /etc/inittab
  \ run only as root(or sudo) else telinit is not even in path


* if you have the segfault line in the log (eg. dmesg) then
  \ http://coredump.io/blog/2012/02/23/debugging-segfaults-from-logs-to-gdb/
  \ also can use this hex calculator for the difference: http://www.miniwebtool.com/hex-calculator/
  \ gdb / info symbol

* If you have something like this nf_send_reset+0x3a/0x140 and you want to gdb
  \ see: https://bugzilla.kernel.org/show_bug.cgi?id=97631#c0
  \ the key is: (gdb) list *nf_send_reset+0x3a
  \ it should list the source code next.
  \ eg. 3: /usr/lib64/xorg/modules/drivers/vboxvideo_drv.so (0x3448d39e000+0x839c) [0x3448d3a639c]
  \ gdb /usr/lib64/xorg/modules/drivers/vboxvideo_drv.so
  \ list *0x839c
  \ works, shows:
  \ 0x839c is in VBoxVideoGetVRAMSize() (/usr/include/xorg/compiler.h:381).
  \ 381     __asm__ __volatile__("inl %1,%0":"=a"(ret):"d"(port));
  \ which is called here: /usr/src/debug/x11-drivers/xf86-video-virtualbox-5.0.2/VirtualBox-5.0.2/src/VBox/Additions/x11/vboxvideo/vboxvideo.c:906
  \ 906     pVBox->cbFBMax = VBoxVideoGetVRAMSize();
  \ that's why startx segfaults above, because of that 'Disable privileged I/O' CONFIG_GRKERNSEC_IO
  \ ok "fix" by disabling that option!


* (gentoo)startx also segfaults when grsec is enabled(not RBAC tho), 
  \ even though I have that I/O patch which adds -hwaccess flag
  \ ...
  \ [ 2074.742883] grsec: denied resource overstep by requesting 21 for RLIMIT_NICE against limit 0 for /usr/bin/xinit[xinit:24835] uid/euid:1000/1000 gid/egid:1000/1000, parent /usr/bin/startx[startx:24819] uid/euid:1000/1000 gid/egid:1000/1000
  \ ...
  \ [ 2075.022772] grsec: denied use of ioperm() by /usr/bin/Xorg[X:24836] uid/euid:1000/0 gid/egid:1000/1000, parent /usr/bin/xinit[xinit:24835] uid/euid:1000/1000 gid/egid:1000/1000
  \ what looks like in Xorg.0.log :
  \ [  2075.036] (EE) 
  \ [  2075.037] (EE) Backtrace:
  \ [  2075.038] (EE) 0: /usr/bin/X (xorg_backtrace+0x80) [0x20554cfe60]
  \ [  2075.038] (EE) 1: /usr/bin/X (0x20552e1000+0x1f3ee0) [0x20554d4ee0]
  \ [  2075.039] (EE) 2: /lib64/libc.so.6 (0x3c844fbb000+0x34920) [0x3c844fef920]
  \ [  2075.039] (EE) 3: /usr/lib64/xorg/modules/drivers/vboxvideo_drv.so (0x3c840fa8000+0x839c) [0x3c840fb039c]
  \ [  2075.040] (EE) 4: /usr/lib64/xorg/modules/drivers/vboxvideo_drv.so (0x3c840fa8000+0x6391) [0x3c840fae391]
  \ [  2075.040] (EE) 5: /usr/bin/X (InitOutput+0xab8) [0x205538add8]
  \ [  2075.041] (EE) 6: /usr/bin/X (0x20552e1000+0x5c11e) [0x205533d11e]
  \ [  2075.041] (EE) 7: /lib64/libc.so.6 (__libc_start_main+0x114) [0x3c844fdb954]
  \ [  2075.042] (EE) 8: /usr/bin/X (_start+0x29) [0x2055324349]
  \ [  2075.042] (EE) 
  \ [  2075.043] (EE) Segmentation fault at address 0x0
  \ [  2075.043] (EE) 
  \ Fatal server error:
  \ [  2075.044] (EE) Caught signal 11 (Segmentation fault). Server aborting
  \ [  2075.044] (EE) 
  * looks like that X patch(xorg-nohwaccess.patch) isn't doing its job, because without the 'Disable privileged I/O' CONFIG_GRKERNSEC_IO it works, startx works.
    \ but that polkitd still crashes (unrelate tho)
    \ [  305.996534] grsec: exec of /usr/libexec/dbus-daemon-launch-helper (/usr/libexec/dbus-daemon-launch-helper org.freedesktop.PolicyKit1 ) by /usr/libexec/dbus-daemon-launch-helper[dbus-daemon:9907] uid/euid:101/101 gid/egid:246/246, parent /usr/bin/dbus-daemon[dbus-daemon:9906] uid/euid:101/101 gid/egid:246/246
    \ [  306.019402] grsec: exec of /usr/lib64/polkit-1/polkitd (/usr/lib/polkit-1/polkitd --no-debug ) by /usr/lib64/polkit-1/polkitd[dbus-daemon-lau:9907] uid/euid:0/0 gid/egid:0/0, parent /usr/bin/dbus-daemon[dbus-daemon:9906] uid/euid:101/101 gid/egid:246/246
    \ [  306.062775] grsec: chdir to /var/lib/polkit-1 by /usr/lib64/polkit-1/polkitd[polkitd:9907] uid/euid:102/102 gid/egid:245/245, parent /usr/bin/dbus-daemon[dbus-daemon:9906] uid/euid:101/101 gid/egid:246/246
    \ [  306.131069] grsec: denied RWX mmap of <anonymous mapping> by /usr/lib64/polkit-1/polkitd[polkitd:9907] uid/euid:102/102 gid/egid:245/245, parent /usr/bin/dbus-daemon[dbus-daemon:9906] uid/euid:101/101 gid/egid:246/246
    \ [  306.131281] polkitd[9907]: segfault at 10 ip 000003df5dab0ce7 sp 000003f375186890 error 4 in libpthread-2.21.so[3df5daa7000+18000]
    \ [  306.131351] grsec: Segmentation fault occurred at 0000000000000010 in /usr/lib64/polkit-1/polkitd[polkitd:9907] uid/euid:102/102 gid/egid:245/245, parent /usr/bin/dbus-daemon[dbus-daemon:9906] uid/euid:101/101 gid/egid:246/246
    \ [  306.131764] grsec: bruteforce prevention initiated due to crash of /usr/lib64/polkit-1/polkitd against uid 102, banning suid/sgid execs for 15 minutes.  Please investigate the crash report for /usr/lib64/polkit-1/polkitd[polkitd:9907] uid/euid:102/102 gid/egid:245/245, parent /usr/bin/dbus-daemon[dbus-daemon:9906] uid/euid:101/101 gid/egid:246/246
    \ polkitd crashing is fixed: https://bugs.gentoo.org/show_bug.cgi?id=559436
    \ ^ was because lacking kernel config option: CONFIG_PAX_PT_PAX_FLAGS

* (gentoo)polkitd segfaults when grsec is enabled(not RBAC tho), in Symbol "pthread_mutex_lock" is at 0x9cd0 + 23 (aka 0x9ce7) in /lib64/libpthread-2.21.so
  \ see above

* this happens with apparently no bad effects:
  \ [ 2926.973983] grsec: From 10.0.2.2: denied RWX mmap of <anonymous mapping> by /usr/lib64/python-exec/python3.4/portageq[portageq:25050] uid/euid:0/0 gid/egid:0/0, parent /usr/bin/gcc-config[gcc-config:25049] uid/euid:0/0 gid/egid:0/0



* to emerge a binary package(eg. that was saved by emerge before upgrading it to a newer version)
  \ time emerge -av --usepkgonly =firefox-39.0.3
  \ Note existing file: /usr/portage/packages/www-client/firefox-39.0.3.tbz2

* good gentoo info
  \ https://devmanual.gentoo.org/ebuild-writing/
  \ https://devmanual.gentoo.org/eclass-reference/index.html


* disable NMI selftest in kernel running inside virtualbox or it will panic on boot if you press any keys or mouse mouse(touchpad) - at least with hardened kernel 4.1.6-hardened-r1-g45b4b78
  \ CONFIG_DEBUG_NMI_SELFTEST
  \ to catch the exact panic msg (while in virtualbox) you might need to add the following to kernel cmdline: console=tty1,ttyS0,115200n8 earlyprintk=vga,serial,ttyS0,115200,keep
  \ ^ but beware you will get hung tasks due to the slow printf to serial, eg. NMI watchdog: BUG: soft lockup - CPU#3 stuck for 23s! [kworker/3:1:44]
  \ ^ "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.


* emerge with grsec on gentoo hardened will not work... /bin/sh: bad interpreter: Permission denied
  \ eg.
  \ >>> Unpacking VirtualBox-5.0.2.tar.bz2 to /var/tmp/portage/app-emulation/virtualbox-guest-additions-5.0.2/work
  \ /var/tmp/portage/app-emulation/virtualbox-guest-additions-5.0.2/temp/environment: /var/tmp/portage/app-emulation/virtualbox-guest-additions-5.0.2/work/VirtualBox-5.0.2/src/VBox/Additions/linux/export_modules: /bin/sh: bad interpreter: Permission denied
  * to fix:
    \ https://forums.gentoo.org/viewtopic-t-971312-start-0.html
    * this is the TPE's fault, see kernel.grsecurity.tpe sysctl option or kernel config, either disable TPE or add the portage user to that tpe group... more info inside ./5gentoo_vm_hardened.wofl

* failed to mount root at boot? - it's grub2-mkconfig not having SEEN an initramfs image! see /etc/grub.d/10_linux script because you probably used a wrong --kernname=genkernel  name!
  \ [  246.198391] VFS: Cannot open root device "mapper/vgall-rootlvol" or unknown-block(0,0): error -6
  \ [  246.458353] Please append a correct "root=" boot option; here are the available partitions:
  \ ...
  \ [  247.638880] DEBUG_BLOCK_EXT_DEVT is enabled, you need to specify explicit textual name for "root=" boot option.
  \ [  247.927275] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
  \ or it may take longer:
  \ [  467.749741] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
  * it's because --kernname=1genkernelgrsec passed to genkernel (either name too long, or that 1 is doing this, or I'm missing the point and it was something else! yep it's something else: grub2-mkconfig seeing only hardcoded filenames!; but another previous variant worked fine: --kernname=genkernelgrsec  so w/o that 1 in front! but this worked only because old filenames with initramfs-genkernel-* name existed in the boot folder and grub2-mkconfig used those! )
    \ //this works: --kernname=ggrsec  (XXX: NOPE, it just used the initramfs-genkernel-* ones!)
    \ or this works: --kernname=genkernel  (this is the only one that works!)
    \ XXX: future note: I should've figured out why this didn't work in the first place, so it wouldn't've bitten me later. Don't let issues go unsolved! Always find root cause and thus make sure they are fully understood!
    * ok now I've used --kernname=ggrsec and although it used to work before with 4.1.6-hardened-r1, it doesn't right now, with 4.1.6-hardened-r2; retrying...
      \ removed any leftover 1genkernelgrsec files (3 of them) from /bewt
      \ still the same.
      \ [  466.074012] VFS: Cannot open root device "mapper/vgall-rootlvol" or unknown-block(0,0): error -6
      \ [  466.314836] Please append a correct "root=" boot option; here are the available partitions:
      \ [  466.538679] 103:00000   83886080 sda  driver: sd
      \ [  466.679124]   103:80000       4096 sda1 25db916d-b655-435c-9fe4-031ea304accf
      \ [  466.869295]   103:40000    1048576 sda2 ea1404b3-a5c9-4e2f-8f85-7fdaca31ff6f
      \ [  467.049621]   103:c0000   82831360 sda3 7bfc903b-b394-4481-ac27-51abc031b3b6
      \ [  467.234154] 103:20000  104857600 sdb  driver: sd
      \ [  467.364389] 0b00         1048575 sr0  driver: sr
      \ [  467.509133] DEBUG_BLOCK_EXT_DEVT is enabled, you need to specify explicit textual name for "root=" boot option.
      \ [  467.746512] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
      \ [  467.749741] CPU: 2 PID: 1 Comm: swapper/0 Tainted: G             L  4.1.6-hardened-r2-g45b4b78 #1
      \ [  467.749741] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006
      \ [  467.749741]  ffffffff926097c3 0000000000000000 0000000000000000 0000000000008001
      \ [  467.749741]  ffffc9000189bda8 ffffffff92044230 ffffffff926b0398 ffffffff928dd420
      \ [  467.749741]  ffffc9000189be38 ffffffff92041446 ffffffff00000010 ffffc9000189be48
      \ [  467.749741] Call Trace:
      \ [  467.749741]  [<ffffffff92044230>] dump_stack+0x45/0x5d
      \ [  467.749741]  [<ffffffff92041446>] panic+0xc7/0x20a
      \ [  467.749741]  [<ffffffff9281579b>] mount_block_root+0x220/0x2b9
      \ [  467.749741]  [<ffffffff92815888>] mount_root+0x54/0x5e
      \ [  467.749741]  [<ffffffff928159c2>] prepare_namespace+0x130/0x16d
      \ [  467.749741]  [<ffffffff928153de>] kernel_init_freeable+0x1e0/0x214
      \ [  467.749741]  [<ffffffff9203ec90>] ? rest_init+0x80/0x80
      \ [  467.749741]  [<ffffffff9203ec99>] kernel_init+0x9/0xf0
      \ [  467.749741]  [<ffffffff920520be>] ret_from_fork+0x3e/0x70
      \ [  467.749741]  [<ffffffff9203ec90>] ? rest_init+0x80/0x80
      \ [  467.749741] Kernel Offset: 0x10800000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
      \ [  467.749741] ---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
      * booting the previous kernel (-r1) still works fine.
      - checking if the cause is the change that I made with 3000_avoid_a_warning.patch which changes arch/x86/include/asm/uaccess.h +112   although it shouldn't be(the cause)! (this recompiles whole kernel apparently, that's how deep it is; 39mins)
        \ orig   : if (type != VERIFY_WRITE) {
        \ patched: if ((type) != VERIFY_WRITE) {
        \ orig gives this warning: ./arch/x86/include/asm/uaccess.h:112:14: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
        \ in lib/iov_iter.c:844   if (unlikely(!access_ok(!rw, buf, len)))
        \ hit when compiling lib/iov_iter.o
        * but ofc that wasn't it!!
      * recompiling old kernel to see if it still works (having already the .o files intact)
        \ took 7m45s anyway
        \ works!
      - recompiling old kernel with a make clean(as root was) first
        \ took: 43m1s
        \ btw the command use was always this:
        \ # time genkernel all --bootdir="/bewt" --install --symlink --no-splash --no-mountboot --makeopts="-j4 V=0" --no-keymap --lvm  --no-mdadm --no-dmraid --no-zfs --no-multipath --no-iscsi --disklabel --luks --no-gpg --no-netboot --no-unionfs --kernname=ggrsec --no-firmware --no-integrated-initramfs --compress-initramfs --compress-initrd --compress-initramfs-type=best --loglevel=5 --color --no-mrproper --no-clean --no-postclear --oldconfig
        \ (also obviously did the grub2-mkconfig everytime so far!)
        \ panic'd prolly because grub didn't see or add any initramfs to the grub.cfg
      * so, thanks to iamben on #gentoo freenode irc for helping me realize that grub2-mkconfig wasn't finding my initramfs files!
        \ the reason is in /etc/grub.d/10_linux which matches only initramfs-genkernel-* filenames! which means I should only use --kernname=genkernel  when invoking genkernel!



* man fails with: could not launch PAGER: No such file or directory
  \ https://bugs.gentoo.org/show_bug.cgi?id=559490

- keep pulseaudio(inside virtualbox) on Analog Stereo Duplex (not Output) or else you get Dummy Output only the next time you restart.
  \ although, looks like it worked ok regardless, on non-hardened(non-grsec) gentoo installation

* no pulseaudio soundcard detected under hardened kernel with grsecurity enabled?
  \ deselect CONFIG_GRKERNSEC_SYSFS_RESTRICT aka [ ] Sysfs/debugfs restriction
  \ https://wiki.gentoo.org/wiki/Talk:PulseAudio#Keep_CONFIG_GRKERNSEC_SYSFS_RESTRICT_deselected_for_pulseaudio_to_..._work.

* pulseaudio inside virtualbox works but there's no sound heard on host
  \ https://wiki.gentoo.org/wiki/Talk:PulseAudio#with_Virtualbox_5.0.0_sound_works_inside_guest_OS_but_is_not_heard_on_host_OS
  * fixedme:
    \ +      <AudioAdapter controller="AC97" driver="Pulse" enabled="true"/>
    \ -      <AudioAdapter controller="AC97" codec="AD1980" driver="Pulse" enabled="true"/>
    \ that extra codec=  prevents the sound from being heard on host, even though it works fine on guest(according to the observed gfx levels)!
    \ this is inside the *.vbox file! (true for, at least, virtualbox 5.0.0 r101573)
    \ tested on song: https://www.youtube.com/watch?v=73Jrq1sk8Y4
    \ also when moving output volume sliders, sounds are being made automatically
    \ Forgot to mention that the codec="AD1980" is added automatically by virtualbox when the virtual machine (Type: Linux version: Gentoo (64bit)) is created, on virtualbox 5.0.0 r101573 but not on a version 4.* virtualbox
    \ Also worth noting that selecting Intel HD Audio(from the default ICH AC97) and then selecting back ICH AC97 will clear this codec flag and all is well. (OK must be pressed after each selection, ofc.) (This is in virtualbox on host, in Settings->Audio->Audio Controller ) 


* youtube videos playing are delayed(even audio-wise: freezes) due to copying files (with mc for example; or even while compiling) even just through tmpfs drives.
  \ so it's not a matter of cpu usage (unless it's btrfs lzma taking all cpu slices, or something like cli-sti during the compression, so to speak)
  \ it's also not a matter of disk writing/syncing, since it happens between tmpfs drives (even just copying 23M of a package like cairo)
  \ XXX: apparently works fine now, the next day that is.
  \ may or may not be related to RCU which was supposedly disabled? which is good(?) - or rather, expert rcu settings was disabled.

* copy/pasting into youtube comments not working in firefox?
  * set dom.event.clipboardevents.enabled false
    \ in about:config
    \ src: http://merabheja.com/fix-can-not-paste-text-in-youtube-comments-using-mozilla/
    \ TODO: this means that RightToClick isn't fucking working!!! since I had the same thing disabled with it! and had it run on all sites... so wtf.

* gdb backtrace to file
  \ src: https://blog.cryptomilk.org/2010/12/23/gdb-backtrace-to-file/
  * set logging overwrite on
  * set logging file gdb.bt
  * set logging on
  * set pagination off
  * thread apply all bt full
  * set logging off
  * quit

* undefined symbol vgaHWFreeHWRec  on startx in /var/log/Xorg.0.log
  * switch to vanilla gcc and recompile x11-drivers/xf86-video-virtualbox


* this chrome emerge took 59m49s
  \ time emerge -av =www-client/google-chrome-unstable-47.0.2508.0_p1
  \ 5 packages
  \ inside grsec virtualbox (see 5gentoo_vm_hardened.wofl )

* # time quickpkg chromium
  \ www-client/chromium-47.0.2498.0
  \ took 28m6s  (uses only 1 core btw)


* time emerge -avK1 =chromium-47.0.2498.0
  \ 37m50s hitting the disk (non-tmpfs)

* chromium download link: https://commondatastorage.googleapis.com/chromium-browser-official/chromium-47.0.2508.0-lite.tar.xz
  \ when emerge doesn't find it on any mirrors(404) for 3 days now, then that url will work just fine, download it in /usr/portage/distfiles/

* emerging non ccached chromium www-client/chromium-47.0.2508.0
  \ took: 1005m45s before ld being killed due to out of memory!
  \ had no swap; was inside virtualbox; total RAM inside was MemTotal:       10809864 kB

* after removing bin packages, update the ${PKGDIR}/Packages index by this command:
  * emaint --fix binhost
    \ it's instant

* virtualbox causes startx to get into 720x400 (unsure about the last number) even though it passes through 800x600
  \ this happens when View->Autoresize guest display (Host+G) is unselected!
  * to fix: switch resolution to wanted (eg. 1024x768 via Start->Display ) then select the previously deselected: View-> Auto-resize guest display (Host+G), then deselect it again(or keep it selected whatever).
    \ xrandr shows the first resolution as * and thus preferred.
    \ XXX: caveat: you'll need to switch to 1024x768 again on next startx, since it's now 1024x690 for whatever reason(even with Auto-resize being deselected!


* this fixes the frequent : Unable to unshare: EPERM
  \ this happens inside a manually chroot-ed environment in which you run emerge/portage
  \ workaround/fix: sysctl -w kernel.grsecurity.chroot_caps=0
  \ in dmesg is probably this: [75212.656718] grsec: From 10.0.2.2: use of CAP_SYS_ADMIN in chroot denied for /root/admincd/source/usr/lib64/python-exec/python3.4/emerge[emerge:24096] uid/euid:0/0 gid/egid:0/0, parent /root/admincd/source/usr/lib64/python-exec/python3.4/emerge[emerge:4652] uid/euid:0/0 gid/egid:0/0
  \ kernel.grsecurity.chroot_caps is kernel config option CONFIG_GRKERNSEC_CHROOT_CAPS:
  \ "If you say Y here, the capabilities on all processes within a
  \ chroot jail will be lowered to stop module insertion, raw i/o
  \ system and net admin tasks, rebooting the system, modifying immutable
  \ files, modifying IPC owned by another, and changing the system time.
  \ This is left an option because it can break some apps.  Disable this
  \ if your chrooted apps are having problems performing those kinds of
  \ tasks.  If the sysctl option is enabled, a sysctl option with
  \ name "chroot_caps" is created."

* need isoinfo ? on manjaro  (or gentoo)
  \ on manjaro, it's in package name: extra/cdrkit
  \ on gentoo: app-cdr/cdrtools

* swap sda with sdb?
  \ src: https://ubuntuforums.org/showthread.php?t=966665&p=6083606#post6083606
  * udev
    * created a file called 10-local.rules in /etc/udev/rules.d
      \ # If the kernel matches a device as sda, change it to sdb.
      \ KERNEL=="sda", NAME="sdb"
      \
      \ # Vice versa.
      \ KERNEL=="sdb", NAME="sda"

* to scan/activate all logical volumes
  \ vgchange -ay
  \ no extra params needed
* to deactivate all logical volumes
  \ vgchange -an
  \ no extra params needed

* grub rescue shell commands:
  \ https://www.gnu.org/software/grub/manual/html_node/GRUB-only-offers-a-rescue-shell.html
  \ set, ls, set prefix=(hd0,1)/grub, set root=(hd0,1), insmod normal, normal
  \ https://help.ubuntu.com/community/Grub2/Troubleshooting
  \ dump, exit, normal, ls, cat, multiboot, chain, help, search, insmod, set, linux, unset
  \ (help was definitely not available for me! maybe because it couldn't find the grub_bios partition that I've set aside for it? due to my chaning the protective MBR's 0xEE partition type to something else thus not seeing the GPT partitions where grub_bios one is)

* workaround for my Lenovo Z575 BIOS not willing to boot from a disk with GPT
  \ Device     Boot Start        End    Sectors   Size Id Type
  \ /dev/sdb1  *        0          0          0     0B 10 OPUS
  \ /dev/sdb2           1 1953525167 1953525167 931.5G ee GPT
  \ it boots now!

* Ctrl+4 (or Ctrl+Alt+4) causes core dump, in xfce4-terminal while at something like a prompt in emerge -nav
  \ see if Alt key is needed; I remember this from long ago, and it was just Ctrl+4

* no audio (no sound) in vlc on a .webm or .mkv file? then re-emerge vlc with USE=matroska  (yes really!)
  \ https://github.com/rg3/youtube-dl/issues/7048

* libreoffice
  \ Total: 42 packages (41 new, 1 in new slot), Size of downloads: 257501 KiB
  \ duration: mother of god this takes ages, wth! 
  \ real  514m10.578s
  \ user  1272m39.346s
  \ sys 304m11.872s
  \ until out of memory fail!!! 14G of tmpfs used!
  \ tmpfs                        14G   14G   68M 100% /var/tmp/portage
  \ re-emerging on disk(not tmpfs), naturally using ccache, 
  \ duration: 51m27s (disk space used during compilation, in /var/tmp/portage/ : 21G)
  \ NEXT-time emerge the git version, this way, ccache can be re-used during versions!
  * TODO: or even better, don't use this at all!
    * switch to using google docs


* when emerge --update cannot find some files to download
  \ either download them manually by finding them on google
  \ OR some other you cannot find like openrc, from https://dev.gentoo.org/~williamh/dist/

* fstrim on btrfs will trim less than free space reported by df
  \ time sudo fstrim -v --all
  \ /: 2.3 GiB (2464907264 bytes) trimmed
  \ which is the diff between 67 and 65 in:
  \ sudo btrfs filesystem df /
  \ Data, single: total=67.01GiB, used=65.43GiB
  \ System, single: total=4.00MiB, used=16.00KiB
  \ Metadata, single: total=3.01GiB, used=1.29GiB
  \ GlobalReserve, single: total=448.00MiB, used=0.00B
  \ even though df reports:
  \ /dev/mapper/vgall-rootlvol  392G   68G  324G  18% /
  * this is not true when not using hardened and/or pax kernel!
    \ time sudo fstrim -v --all
    \ /: 356.2 GiB (382485479424 bytes) trimmed
    \ real  0m32.533s
    \ user  0m0.004s
    \ sys 0m15.555s
    \ sudo btrfs filesystem df /
    \ Data, single: total=95.00GiB, used=41.52GiB
    \ System, single: total=32.00MiB, used=16.00KiB
    \ Metadata, single: total=3.00GiB, used=1.10GiB
    \ GlobalReserve, single: total=384.00MiB, used=0.00B




* fresh hardened-kernel compilation time
  \ real 25m54.190s
  \ user 56m6.213s
  \ sys 9m24.217s

* list all packages that won't get updated via emerge --update @world
  \ equery l '*9999*'
  \ for these you need to emerge -av !
  * actually updating them all like this works nicely! (equery piped output changes to be nice, at the expense of not being able to grep search the original unpiped one which is useful in other cases(different args to equery, eg. equery u vim , can't grep that for descriptions, well, nevermind there's --no-pipe))
    \ //time emerge -av `equery l '*9999*'`
    \ //well, that doesn't work since it needs an '=' in front of each atom!! else, eg. !!! 'app-editors/vim-9999' is not a valid package atom.
    \ so this works: time emerge -av `equery l '*9999*' | sed -e 's/^/=/g'`
  * update anything else(as root ofc)  - gentoo system update (for searches)
    \ time emerge --verbose --tree --update --deep --with-bdeps=y --changed-use --ask @world
    \ DON'T forget this is a prerequisite: time emerge-webrsync -v -k



* keeping this deselected in firefox: Use hardware acceleration when available
  \ because 16fps is fastest (than 5 or 9 fps with hwaccel)
  \ and because it may crash the radeon driver (like vlc does!)
  \ also tested with non-hardened profile+kernel and firefox 43.0(recompiled with vanilla non-hardened(at this point) gcc)

* fix this: The following REQUIRED_USE flag constraints are unsatisfied: exactly-one-of ( python_single_target_python3_4 python_single_target_python3_5 ) when emerging libreoffice-9999
  \ this temp fix works:
  \ # time PYTHON_SINGLE_TARGET="python3_4" emerge -nav =libreoffice-9999
  \ But the permanent fix for this is: 
  \ # vim /etc/portage/package.env
  \ =app-office/libreoffice-9999 libreoffice.conf
  \ 
  \ # vim /etc/portage/env/libreoffice.conf
  \ PYTHON_SINGLE_TARGET="python3_4"

* rust.vim needs syntastic vim plugin!
  \ # time PYTHON_SINGLE_TARGET="python3_4" emerge -nav =libreoffice-9999

* emerging app-office/libreoffice-5.0.9999  (without debugging symbols! and non-hardened stuff) takes about 4.1gig in /var/tmp/portage
  \ duration (with previous ccache hits):
  \ real  42m19.836s
  \ user  36m22.286s
  \ sys 82m24.550s

* xfdesktop without thunar USE flag won't be able to display desktop icons (only the ones from the minimized windows instead!)
  \ untested! but believed to be so!
  \ besides, I don't have thunar installed, only have pcmanfm instead! and this will make xfdesktop not work in the sense of displaying launcher icons on desktop!
  \ apparently works only after a restart (that is, once set that option)

* chromium suid root sandbox
  \ https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox.md


- less
  \ up/down keys don't work as they should while in / mode - they gen ESCOA, ESCOB
  * auto-downgraded from 482 to 481 and it's fixed now!

* make any iso bootable with isohybrid (that is, bootable from USB; since it was already bootable from CD/DVD)
  \ just run: isohybrid file.iso
  \ and it's modified in place to be bootable from USB
  \ FIXME: doesn't work for memtest86+*.iso
  * get memtest86+ bootable from USB from Linux (UNTESTED!!! I only used it from system-rescue-disc iso)
    \ http://forum.canardpc.com/threads/28875-Linux-HOWTO-Boot-Memtest-on-USB-Drive


* memtest86+ freezes at test 7 from 4096-6144(or something like that) address but only when using 2 cores (SMP)! (so it doesn't freeze in failsafe mode for example) - should work when using SMP with round robin cores (a setting there)
  \ src: http://forum.canardpc.com/threads/84663-Memtest86-is-freezing-while-running-test-7
  \ it's apparently memtest86+'s fault!!!
  - (nope)possible fix(untested tho):
    \ - Memtest freezes or my system crashes/reboots.
    \ Check that you have USB legacy support disabled in your BIOS setup. Some
    \ BIOSes have a bug in them that reports the reserved memory areas
    \ incorrectly in the e820 memory map. This causes memtest to write over the
    \ memory area used by the USB legacy support resulting in freezes or reboots.
    * unfortunately I need that to boot memtest86+ !

* syslinux's altmbr.bin files explanation
  \ is here: https://github.com/yoshi314/multi-live-usb-configs/

* unetbootin is once again proving to be a piece of junk!
  \ no copying of .c32 files, nor updating/writing the mbr
  \ who knows what else it didn't do!

* how to crash chromium - Aw, Snap!
  \ Received signal 8 FPE_INTDIV 7fe5168a5200
  \ #10 0x7fe5166ba9f9 vpx_codec_decode
  \ view this video: https://www.youtube.com/watch?v=2pbEarwdusc
  \ this only works on my bugged CPU! Thanks AMD!
  \ https://bugs.chromium.org/p/chromium/issues/detail?id=599899


* how to add another IP:
  \ ifconfig eth0:1 192.168.0.3
  \ now you have eth0 192.168.0.2(supposedly) and eth0:1 192.168.0.3 !
  \ src: man pure-ftpd
  \ There's another way without adding a new virtual eth, and that's via 'ip addr'

* how to dual push when 'git push' happens = push to two repositories when a git push happens!
  \ src: https://stackoverflow.com/questions/14290113/git-pushing-code-to-two-remotes
  * ensure you have an origin remote already
    \ git remove -v show
    \ eg. git@github.com:respeccing/hsts-everywhere-chrome.git
  * re-add the same origin remote
    \ eg. git remote set-url --add --push origin git@github.com:respeccing/hsts-everywhere-chrome.git
    \ now  git remote -v show   will show the same thing as before! (this is expected/good!)
    \ origin  git@github.com:respeccing/hsts-everywhere-chrome.git (fetch)
    \ origin  git@github.com:respeccing/hsts-everywhere-chrome.git (push)
  * add the new url(s) to the same origin remote
    \ eg. git remote set-url --add --push origin git@notabug.org:respeccing/hsts-everywhere-chrome.git
    \ now  git remote -v show  will show this url too:
    \ origin  git@github.com:respeccing/hsts-everywhere-chrome.git (fetch)
    \ origin  git@github.com:respeccing/hsts-everywhere-chrome.git (push)
    \ origin  git@notabug.org:respeccing/hsts-everywhere-chrome.git (push)
  * now git push will push to both
    \ ssh key password will be requested twice!
    * recommended command to use the first time(after repo(s) creation):
      \ git push -u --all
      \ you see something like this(for that -u --all combination!):
      \ ..
      \ Branch kerneltry1 set up to track remote branch kerneltry1 from origin.
      \ Branch master set up to track remote branch master from origin.
      \ Branch test_kernel_s_msr_write set up to track remote branch test_kernel_s_msr_write from origin.
      \ ...
      \ then: git push --tags
    * subsequently use command: git push

* check if site is enabling HSTS
  \ curl -SsI "https://grc.com"
  \ -S show error if fail
  \ -s silent
  \ -I only header
  \ HSTS is supposedly set only for when talking https, not http! eg. try curl -SsI "grc.com" and you don't see it! src: https://www.chromium.org/hsts
  * use chrome extension: https://github.com/redpois0n/hsts-everywhere-chrome (or my fork of it, if you're me and plan on using http only with firefox, never with chromium!)

* python cheatsheet
  \ https://www.newthinktank.com/2014/11/python-programming/
  \ src: https://www.youtube.com/watch?v=N4mEzFDjqtA

* battery charge/discharge thresholds  ie. how to charge until 80% and discharge only until 40%
  \ https://askubuntu.com/questions/34452/how-can-i-limit-battery-charging-to-80-capacity
  \ http://www.thinkwiki.org/wiki/Tp_smapi
  \ see which is last and maybe get that one: # equery m app-laptop/tp_smapi
  \ emerge it: # emerge -nav app-laptop/tp_smapi
  \ emerge last one: # emerge -nav =app-laptop/tp_smapi-0.41-r1

* test an in-progress pull request from github, on your locally cloned repo.
  * first time
    \ git clone therepo
    \ cd therepo
    \ git fetch origin pull/191/head
    \ git checkout -b branchnamehere FETCH_HEAD
  * for subsequent updates
    \ git fetch origin pull/191/head && git merge FETCH_HEAD

* in arch/manjaro pacstrap is in package arch-install-scripts (needed for playpen)
  \ https://github.com/thestinger/playpen
  * git clone https://github.com/thestinger/playpen.git
  * sudo pacman -S arch-install-scripts
  * git clone https://github.com/rust-lang/rust-playpen.git
  * get .vimrc
    * git clone https://github.com/respeccing/gentooskyline.git
    * cd gentooskyline/
    * cp './system/Z575/OSes/gentoo/on_baremetal/filesystem_now/gentoo/home/zazdxscf/.vimrc' ~/.vimrc
  * compile playpen
    * cd playpen 
    * make
    * cd ..
  * cd rust-playpen
    * init
      * sudo ./init.sh
    * run
      * ./web.py
  * get rust-playpen requirements for running web.py
    * sudo pacman -S community/python-bottle community/python-pygments community/python-cherrypy
  * get pull request as patch - DON'T FORGET TO MAKE A NEW BRANCH FIRST!
    \ wget https://github.com/rust-lang/rust-playpen/pull/143.patch
    * ensure git is configured - needed for git am
      \ git config --global user.email "you@example.com"
      \ git config --global user.name "Your Name"
    * apply
      \ git am 143.patch
      * if failed
        * look at failed patch
          \ vim .git/rebase-apply/patch
          \ :set syntax=diff
        * see if it's only a matter of tabs vs spaces
          \ %s/ctrl+i/    /g
          \ worked for me
          \ patch -Np1 -i .git/rebase-apply/patch
        * git add the changes!
          \ git add static/web.css static/web.js
        * then continue
          \ git am --continue
      * oops forgot to make a new branch, make it now
        \ git branch hyperlinklinenumbers d841097
        \ d841097 is the latest commit!
        \ src: https://stackoverflow.com/questions/2816715/branch-from-a-previous-commit-using-git
  * run web.py
    \ as root, else cannot listen on port 80
    * while true; do PATH="$PATH:../playpen/" sudo ./web.py ; done
      \ now just C-c to restart
  * git remote
    * gen key
      \ ssh-keygen -t ed25519 -a 100
    * upload pub key to github
    * remote add
      \ git remote add upstream git@github.com:respeccing/rust-playpen.git
    * push up
      \ git push -u upstream hyperlinklinenumbers


* check manjaro iso sig
  * get *.iso and *.sig
  * get key
    \ gpg --no-default-keyring --keyring vendors.gpg --keyserver pgp.mit.edu --recv-key 11C7F07E
    \ that creates:
    \ gpg: keybox '/home/zazdxscf/.gnupg/vendors.gpg' created
    \ gpg: /home/zazdxscf/.gnupg/trustdb.gpg: trustdb created
  * check key
    \ gpg --verify --verbose --keyring vendors.gpg manjaro-xfce-16.06-pre1-x86_64.iso.sig
    \ that will check the sig for the file manjaro-xfce-16.06-pre1-x86_64.iso
    \ output:
    \ gpg: assuming signed data in 'manjaro-xfce-16.06-pre1-x86_64.iso'
    \ gpg: Signature made Sun Mar  6 11:57:51 2016 CET using RSA key ID 11C7F07E
    \ gpg: using PGP trust model
    \ gpg: Good signature from "Philip M�ller (Called Little) <philm@manjaro.org>" [unknown]
    \ gpg: WARNING: This key is not certified with a trusted signature!
    \ gpg:          There is no indication that the signature belongs to the owner.
    \ Primary key fingerprint: E4CD FE50 A2DA 85D5 8C8A  8C70 CAA6 A596 11C7 F07E
    \ gpg: binary signature, digest algorithm SHA256, key algorithm rsa2048

* systemd nixos rules for boot.loader.grub.device
  \ src: https://stackoverflow.com/questions/28339702/install-grub-on-a-disk-drive-by-uuid
  \ also: https://github.com/NixOS/nixos/blob/master/modules/programs/virtualbox.nix
  \ XXX: but do use /dev/disk/by-id/  for now! The above is just for future usage; eg. template for systemd auto-creation of wtws:)

* use raw usb stick or harddrive (eg. partitioned) in virtualbox, as is:
  \ VBoxManage internalcommands createrawvmdk -filename /tmp/guix.vmdk -rawdisk /tmp/guixsd-usb-install-0.10.0.x86_64-linux
  \ src: https://agnipulse.com/2009/07/boot-your-usb-drive-in-virtualbox/
  * alternative way:
    \ src: https://lists.gnu.org/archive/html/guix-devel/2015-02/msg00260.html
    * convertfromraw gnu-usb-install-version-linux-i686 gnu.vdi --format vdi
      \ untested!

* in emacs
  * how to insert a numeric X number of times via M-num or C-u, num  and then the numeric X char; works for non numeric X
    \ M-88 C-u 0  (thanks to unkn2000)
  * can't type C-g after having pressed Esc (aka meta), to cancel it; it only works because M-C-g is undefined.


* guix:
  * WARNING: use only 1 core in virtualbox or you'll get guest kernel hangs!(eg. with 2 or 4 cores tested to hang! which makes me question their kernel!!)
* virtualbox boots faster 
  \ actually(with KVM in 4.6_rc7 kernel), virtualboxed NixOS boots in 53sec(with X too) with 1 core, and in 38sec with 4 cores! and 39sec with 2 cores - note: there's an issue in nixos(unknown) and for some reason X or xfce4 hangs on a black screen for a while.
  \ but without KVM it was slower with 1 and 4 cores than with 2 and 3. (can't remember the numbers!)
  \ GuixSD boots in 21.65sec with 1 core! 18.44sec with 2 cores; 16.55 with 3 core; 16.36sec with 4 cores; and again 1 core in 18.68sec, and 2 cores in - note the time it takes for me to enter user/pwd is all those extra seconds difference...
  \ ok GuixSD with auto cat-ing /proc/uptime after I enter user/pass fast:
  \ 4 cores 14.36sec, 13.40sec
  \

* /proc/uptime
  \ "This file contains two numbers: the uptime of the system (seconds), and the amount of time spent in idle process (seconds)."
  \ src: https://www.linuxquestions.org/questions/linux-general-1/2-numbers-in-proc-uptime-217046/

* avoid grsecurity kernels
  \ why: https://www.reddit.com/r/programming/comments/4gn0dr/hector_martin_on_twitter_how_to_panic_a_current/d2j21xn

* generate that sha256 from NixOS (nix) in gentoo (without getting nix)
  - time sudo emerge -nav dev-python/zbase32
    \ nevermind this
  - git clone https://github.com/tv42/zbase32
  - go shiet
    * cd "$GOPATH"
    * go get github.com/tv42/zbase32
    * cd src/github.com/tv42/zbase32
    * go build -v cmd/zbase32-decode/*.go
    * go build -v cmd/zbase32-encode/*.go
    * echo 13m0s2m0zg304w86yvcmxgbjl41c4kc420044avi8rnr1xwcscsq | ./decode
      \ decode: decoding input: "13m0s2m0zg304w86yvcmxgbjl41c4kc420044avi8rnr1xwcscsq": illegal z-base-32 data at input byte 3
  * nix-hash
    \ src: https://github.com/NixOS/nix/blob/451ebf24ce532f8d59f929efd486104fcebf1aa6/src/libutil/hash.cc#L119
    * base32 sha256 to normal hexa(aka base16) sha256:
      \ nix-hash --type sha256 --to-base32 5833cd780fd96614b722040041d8242c102ad7eb956d6f102760bc0faad0a08e
    * normal sha256 to base32 sha256:
      \ nix-hash --type sha256 --to-base16 13m0s2m0zg304w86yvcmxgbjl41c4kc420044avi8rnr1xwcscsq

* xfce4-terminal search(ctrl+shift+F) Previous is broken, it skips existing ones that Next doesn't skip!
  \ eg. execute the above 2 nix-hash commands, then search Previous for 13m0s2m0zg304w86yvcmxgbjl41c4kc420044avi8rnr1xwcscsq

* atelierPC (the celeron)
  * booting from USB (nixos and manjaro tested)
    \ isolinux.bin missing or corrupt
  * CAN boot from CD though!
  *

* boot any iso from HDD if you already have a working GRUB and linux OS
  \ src: http://www.howtogeek.com/196933/how-to-boot-linux-iso-images-directly-from-your-hard-drive/
  \ src: https://www.system-rescue-cd.org/Sysresccd-manual-en_Easy_install_SystemRescueCd_on_harddisk#Boot_the_ISO_image_from_the_disk_using_Grub2
  * put iso somewhere
    \ eg. /home/z/a.iso
  * sudo fdisk -l
    \ see which partition has that file
    \ /dev/sda3 or in grub speak hd(0,3) which works even if it's (the /boot but) under LUKS
  * sudo vim /boot/grub/grub.cfg
    \ for manjaro and others see src: https://gist.github.com/gorhill/6561765
    \ add grub entry:
    * for system rescue CD iso
      \ menuentry "sysrescd ISO" {
      \ set isofile="/home/z/a.iso"
      \ loopback loop (hd0,3)$isofile #won't work with LUKS
      \ #loopback loop /$isofile #works with LUKS but only half-way! iso's initram needs to be able to open luks device where iso is stored
      \ linux (loop)/isolinux/rescue64 isoloop=$isofile setkmap=us dns=8.8.8.8 dostartx rootpass=/ nocache
      \ initrd (loop)/isolinux/initram.igz
      \ }
      \
      \ right, so setkmap=us to not get the prompt for keyboard
      \ nocache to can easily change to docache if wanted via 'e' key at grub prompt! but my test shows docache has no effect in this case!
      \ rootpass is the root password
    * for Manjaro
      \ for img_dev=/dev/sda3  can be /dev/disk/by-label/wtwlabelsda3hashere or /dev/mapper/luks_on_sda2_boot  where sda3 is the device which contains the .iso file
      \ XXX: you take the line with misolabel=MJRO1606 from inside the .iso under /isolinux/isolinux.cfg
      \
      \ menuentry "manjaro ISO" {
      \ set isofile="/manjaro-xfce-16.06-rc1-x86_64.iso"
      \ loopback loop (hd0,3)$isofile #won't work with LUKS
      \ #loopback loop /$isofile #works with LUKS but only half-way! iso's initram needs to be able to open luks device where iso is stored
      \ linux (loop)/manjaro/boot/x86_64/manjaro setkmap=us img_dev=/dev/sda3 img_loop=$isofile misobasedir=manjaro misolabel=MJRO1606 nouveau.modeset=1 i915.modeset=1 radeon.modeset=1 logo.nologo overlay=free showopts timezone=Europe/Bucharest locale.LANG=en_US.utf8
      \ initrd (loop)/manjaro/boot/x86_64/manjaro.img
      \ }
  * reboot
    \ grub2-mkconfig obviously NOT needed to be run! it will overwrite grub.cfg!

* ssh port forward
  \ eg. ssh -p 8822 -L 55900:127.0.1.2:5900 127.0.0.20 -l user
  \ first it ssh-es to remote's port 8822 (where remote is: 127.0.0.20) and connects are user 'user'
  \ the port forward connects to remote's 127.0.1.2:5900 when you connect to 127.0.0.1:55900 on your local

* are you getting RCU stalls?
  \ INFO: rcu_sched self-detected stall on CPU
  \ INFO: rcu_sched detected stalls on CPUs/tasks:
  \
  \ something about amd_e400_idle
  \
  \ fix:
  \ ensure BIOS setting AMD C1E Support is Disabled or Auto (not Enabled!)
  \ on the desktopPC!

* sunxi_debug
  \ https://github.com/allwinner-zh/linux-3.4-sunxi/blob/e5b270c05bf45557233f54ccb5a5e4de8f67123a/arch/arm/mach-sunxi/sunxi-debug.c

* Lessons In Electric Circuits
  \ free
  \ https://www.ibiblio.org/kuphaldt/electricCircuits/

* Recoll is a good alternative to Everything(which runs on Windows) or, if you will, Google Desktop
  \ https://www.lesbonscomptes.com/recoll/features.html

* looks like CONFIG_X86_PAT can be enabled in kernel config now (tested on kernel 4.6.0-rc7 in gentoo non-hardened, on Z575)
  \ CONFIG_MTRR=y (was set already)
  \ these are new:
  \ CONFIG_MTRR_SANITIZER=y
  \ CONFIG_MTRR_SANITIZER_ENABLE_DEFAULT=0
  \ CONFIG_MTRR_SANITIZER_SPARE_REG_NR_DEFAULT=1
  \ CONFIG_X86_PAT=y

* audio/video chat program?
  \ https://github.com/tux3/qtox

* time blkdiscard -vz /dev/sda
  \ time: real 417m11.934s  user 0m0.000s sys 1m3.093s
  \ on WDC WD20EARS-00S8B1 (2TB)
  \ NOTE: don't run this if you don't want to lose all your data! OBVIOUSLY!

* notabug.org
  * cannot fork a forked repo, it will fork the original repo!
    \ even though it shows correctly that it will next fork the forked repo
    \ https://twitter.com/ActULizeinM8ERL/status/738040858906394624

* which process is writing to disk?
  \ echo 1 > /proc/sys/vm/block_dump
  \ dmesg -w
  \
  \ src: https://unix.stackexchange.com/questions/44103/how-to-find-which-process-is-regularly-writing-to-disk

* mkfs.ext4 for usb stick
  \ mkfs.ext4 -v -O ^has_journal -m 1 -- /dev/sdd1
  \ aka no journal and 1% reserved for root
  \ src: http://heraly.be/wiki/doku.php?id=raspberry:formatusb


* powertop needs CONFIG_AUDIT apparently, but doesn't complain! or else cannot see % CPU states usage, and % other devices use.
  \ but the bad part is that systemd will try to use it(AUDIT) and spam audit messages on due to chromium opening tabs



* fix pulseaudio from listening on 0:0:0:0:4713
  \ tcp        0      0 0.0.0.0:4713            0.0.0.0:*               LISTEN      923/pulseaudio
  * comment out this line in file /etc/pulse/default.pa
    \ load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1
    \ src: https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Network/#index1h2
    \ it was commented in gentoo!


* in mc
  * replace last type char with char 'l'
    \ Alt+[, d, l
    \ or repeat: Alt+[, d
    \ that selects 1 char to the left, aka extends selection to the left, and your next keypress eg. 'l'  will replace the selection with it
  * get keys stuck FIXME?
    \ make sure you have F9,o,c,Alt+y (aka pause after run: always)
    \ exec a command eg. ls
    \ now you see: Press any key to continue...
    \ press Up Arrow then Enter
    \ now it's stuck a bit even if you keep pressing a key eg. s
    \ or press Up Arrow then s key
    \ it doesn't stuck all the time! which is odd!
    \ in last case you have to press key s 19 times to return to UI
    \ now it's 21 of s ...
    \ seems that it's only 1 s then 2 s then 21 s, when u start a new xfce4-terminal then mc

* nmap scan like this:
  \ https://www.digitalocean.com/community/tutorials/how-to-test-your-firewall-configuration-with-nmap-and-tcpdump

* chromium scroll via touchpad(and mouse wheel? apparently) can cause the webpage to go blank
  \ issue: https://bugs.chromium.org/p/chromium/issues/detail?id=615714
  \ chrome://flags
  \ disable smooth scrolling

* umount is still hanging...
  \ and it's function umount2 (libc.so.6)
  \ so this is why it's hanging for like 30sec upon shutdown, most likely
  \ https://bugzilla.kernel.org/show_bug.cgi?id=151621
  * manually free pagecache pages
    \ src: https://unix.stackexchange.com/questions/87908/how-do-you-empty-the-buffers-and-cache-on-a-linux-system/87909#87909
    \ time echo 1 | sudo tee /proc/sys/vm/drop_caches
  * check number of pagecache pages
    \ echo m|sudo tee /proc/sysrq-trigger >/dev/null ; dmesg|grep -F "pagecache pages"|tail -1


* Synchronizing SCSI cache fails?
  * vim /usr/lib/systemd/system-shutdown/debug.sh
    \ #!/bin/bash
    \ sync && sdparm --command=sync /dev/sda && sleep 1
    \ mount -o remount,ro /
    \ #this is the IMPORTANT part:
    \ #turn off drive cache, workaround for https://bugzilla.kernel.org/show_bug.cgi?id=151631
    \ hdparm -W0 /dev/sda
    \
    \ #flush drive cache:
    \ hdparm -F /dev/sda
    \ hdparm -f /dev/sda
    \ sleep 1

* ohci-pci "controller won't resume" "HC died; cleaning up"
  \ https://bugzilla.kernel.org/show_bug.cgi?id=151641

* chromium hangs or slows down during playing youtube videos because of audio issues
  \ must use system-ffmpeg chromium //haven't figured out why or how to fix this!
  \ oh... https://bugs.chromium.org/p/chromium/issues/detail?id=629695

* if powermanager doesn't start
  \ sudo pacman -S libxss

* bug in clock plugin of xfce4-panel
  \ UTC+7 is apparently UTC-7, in the timezone field

* rust IDE?
  \ https://intellij-rust.github.io/features/
  \ git clone the two repos: https://github.com/intellij-rust/intellij-rust and https://github.com/intellij-rust/intellij-toml and follow instruction to build them with gradle(note: it fetches a bunch of intellij stuff twice for each project!)
  \ use install from disk and point to the zip files in ./build/distributions/ for each project(project=intellij-rust and intellij-toml)

* buildroot
  * the manual (doc)
    * required on host:
      \ sudo pacman -S --needed w3m dblatex
      \ NOTE: dblatex takes a while to install!! 5min?
    * build
      \ html manual(needs dblatex):
      \ time make manual
      \ or text only (without dblatex needed):
      \ time make manual-text
    * open:
      \ text: less output/docs/manual/manual.text
      \ html: less /output/docs/manual/manual.html
  * build
    * time make menuconfig
    * time make
      \ fail: configure: error: in `/home/z/build/1nonpkgs/buildroot/buildroot/output/build/gettext-0.19.8.1/gettext-runtime/libasprintf':
      \ configure: error: C++ preprocessor "/lib/cpp" fails sanity check
      \ See `config.log' for more details
      \ configure: error: ./configure failed for libasprintf
      \ make: *** [package/pkg-generic.mk:194: /home/z/build/1nonpkgs/buildroot/buildroot/output/build/gettext-0.19.8.1/.stamp_configured] Error 1

* vlc always starts up maximized?
  \ workaround: rm ~/.config/vlc/vlc-qt-interface.conf

* vlc cuts the ending from a/v (like 0.5sec)
  \ use mplayer(or youtube) to see the real ending

* Rust
  * all the clippy lints
    \ https://manishearth.github.io/rust-clippy/master/
  * intellij rust plugin
    \ doc/keyboard shortcuts: https://intellij-rust.github.io/features/

* youtube videos don't resume where they were left, after browser restart or reload of page
  \ make sure uBlock(not just uMatrix) allows requests to s.youtube.com

* firefox-hg compiles fine but coredumps on startup in libxul.so ?
  \ oops my bad, it's not this://recompile without --disable-wmf !!
  \ to fix, don't use: ac_add_options --enable-optimize=-O2
  \ dang it, and I remember not using that at some point and it still crashed! but it seems i remember wrongly!

* the dumbest issue with symlinked dirs, ever!
  \ Linux myzee 4.8.0-rc1-g29b4817 #20 SMP PREEMPT Mon Aug 8 21:18:27 EEST 2016 x86_64 GNU/Linux
  \ lrwxrwxrwx 1 z    z               24 06.07.2016 05:02 manjarred -> build/1nonpkgs/manjarred/
  * while inside a symlink-dir, you cannot access a relative path file (but bash completion works just fine!)
    \ cd ~/manjarred
    \ ls -la ../build/1packages/firefox-hg/mozconfig
    \ ls: cannot access '../build/1packages/firefox-hg/mozconfig': No such file or directory
    \ cd ..
    \ ls -la ./build/1packages/firefox-hg/mozconfig
    \ -rw-r--r-- 1 z z 22516 09.08.2016 12:59 ./build/1packages/firefox-hg/mozconfig
    \ l
    \ lrwxrwxrwx 1 z    z               24 06.07.2016 05:02 manjarred -> build/1nonpkgs/manjarred/
    \ are you friggin' kidding me with this?!
    \ and of course this works:
    \ /home/z/manjarred $ l ../../../build/1packages/firefox-hg/mozconfig
    \ -rw-r--r-- 1 z z 22615 09.08.2016 13:09 ../../../build/1packages/firefox-hg/mozconfig
    \ it's like I'm in the dir that the symlink points to, even though it doesn't look like that!
    \ l and ls are aliases, so here's to be sure:
    \ /home/z/manjarred $ /usr/bin/ls -la ../../../build/1packages/firefox-hg/mozconfig
    \ -rw-r--r-- 1 z z 22615 Aug  9 13:09 ../../../build/1packages/firefox-hg/mozconfig


* cpupower
  * won't set governor if version is 4.7-1 instead of 4.6-4
    \ https://bugzilla.kernel.org/show_bug.cgi?id=135391
    \ [2016-08-11 00:02] [ALPM] upgraded cpupower (4.6-4 -> 4.7-1)
    \ so, in 4.6-4
    \ "Setting cpu:" is shown
    \ even though you still get this message: modprobe: FATAL: Module msr not found in directory /lib/modules/4.8.0-rc1-g9512c47

* systemd-journald: Missed kernel messages
  \ src: https://bbs.archlinux.org/viewtopic.php?id=172639
  \ add --dmesg to the journalctl command (see ~/bin/logf)
  \ XXX: ok this is bad because it now doesn't show coredumps like it does when --dmesg is not specified!

* after exit mc, copy paste adds 0~ and appends 1~ to whatever was pasted!
  \ aka mouse LMB+RMB (from touchpad) from pasting 0~ and 1~ as paste edges! (in terminal)
  \ a 'reset' command fixed it though, and usually happens after entering mc(even if exited)
  \ bug: https://bugs.launchpad.net/ubuntu/+source/vte/+bug/1350334

* firefox context menu has too many items and none are working
  \ https://bugzilla.mozilla.org/show_bug.cgi?id=1238143
  \ //try: --with-system-icu
  \ //dno if this works yet!
  \ https://bugs.gentoo.org/show_bug.cgi?id=571240#c11
  \ you must use: ac_add_options --with-intl-api
  \ not tested yet! (but it was without so far!)

* btrfs snapshots
  * create new
    \ btrfs subvolume snapshot -r / /backup
  * delete old
    \ btrfs subvolume delete /backup4

* sugar
  \ http://arstechnica.com/science/2016/09/sugar-industry-bought-off-scientists-skewed-dietary-guidelines-for-decades/

* a running adb process causes this spam:
  \ kernel: ohci-pci 0000:00:12.0: ohci_rh_resume: control 643
  \ due to a patched kernel where I added that.
  \ Even though adb listens on 127.0.0.1 apparently.
  \ adb got started by cmd: idea(.sh)

